package com.zkx.blogweb.mapper;

import com.github.pagehelper.PageInfo;
import com.zkx.blogweb.entity.IdArticle;
import com.zkx.blogweb.entity.User;
import com.zkx.blogweb.entity.idArticleExample;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface IdArticleMapper  {

    @MapKey("user_id")
    List<HashMap<Integer,String>> getAllBlogUserName();

    List<IdArticle> getPageIdArticleList(@Param("start") Integer start
            ,@Param("pageSize") Integer pageSize);

    int countByExample(idArticleExample example);

    int deleteByExample(idArticleExample example);

    int deleteByPrimaryKey(Integer articleId);

    int insert(IdArticle record);

    int insertSelective(IdArticle record);

    List<IdArticle> selectByExample(idArticleExample example);

    IdArticle selectByPrimaryKey(Integer articleId);

    int updateByExampleSelective(@Param("record") IdArticle record, @Param("example") idArticleExample example);

    int updateByExample(@Param("record") IdArticle record, @Param("example") idArticleExample example);

    int updateByPrimaryKeySelective(IdArticle record);

    int updateByPrimaryKey(IdArticle record);

    int allArticles();

    Integer selectBlogsById(@Param("userId") Integer userId);

    Integer selectStarsById(Integer userId);

    List<IdArticle> getListByBlogId(@Param("blogId") Integer userId,@Param("startPage") Integer start
            ,@Param("pageSize") Integer pageSize);

    void deleteBlogByUserId(Integer userId);

    List<IdArticle> getRankTop();
}